package com.sxy.demo.sxy;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author wyh_j
 */

/**
 *  select
 *         act.id as activityId,
 *         (case
 *         when ((act.start_time is null and act.end_time is null) or (#{nowTime} > act.start_time and act.end_time > #{nowTime}))
 *         then 1
 *         else 0
 *         end ) as activityStatus,
 *         act.start_time as startTime,
 *         act.end_time as endTime,
 *         spu.goods_id as spuId,
 *         sku.goods_sku_id as skuId,
 *         sku.activity_retail_price as activityPrice,
 *         sku.activity_wholesale_price as activityWholesalePrice,
 *         sku.activity_channel_wholesale_price as activityChannelWholesalePrice,
 *         sku.stock as activityStock,
 *         spu.goods_source as goodsSource
 *         from rms_activity act
 *         inner join rms_activity_goods spu on act.id = spu.activity_id
 *         inner join rms_activity_goods_sku sku on sku.activity_goods_id = spu.id
 *         WHERE act.state = 0 and act.id = #{activityId}
 *         and ((act.start_time is not null and act.end_time is not null and #{nowTime} > act.start_time and act.end_time > #{nowTime}) or (act.start_time is
 *         null and act.end_time is null))
 *         AND spu.goods_id = #{spuId} AND spu.goods_state = 1 and spu.deleted = 0 and sku.deleted=0
 *         <if test="spuId != null">
 *             AND spu.goods_id = #{spuId}
 *         </if>
 *         <if test="skuIdList != null and skuIdList.size() > 0">
 *             AND sku.goods_sku_id in
 *             <foreach collection="skuIdList" item="skuId" open="(" separator="," close=")">
 *                 #{skuId}
 *             </foreach>
 *         </if>
 */
@Data
public class ActivityProductSpecDO implements Serializable {

    private Long activityId;

    private Integer activityStatus;

    private LocalDateTime startTime;

    private LocalDateTime endTime;

    private Long spuId;

    /**
     * 商品规格ID
     */
    private Long skuId;

    /**
     * 商品来源 1:供应链；2:商家
     */
    private Integer goodsSource;

    /**
     * 活动价
     */
    private BigDecimal activityPrice;

    /**
     * 活动批发价
     */
    private BigDecimal activityWholesalePrice;

    /**
     * 活动出厂价
     */
    private BigDecimal activityChannelWholesalePrice;

    /**
     * 活动库存
     */
    private Integer activityStock;


    /**
     * @see ActivityProductSpecDO#activityId
     * @see ActivityProductSpecDO#skuId;
     * @see userId
     */
    private SkuSupplierAssignDO supplierAssign;
    /**
     * @see ActivityProductSpecDO#activityId
     * @see ActivityProductSpecDO#skuId;
     */
    private List<SkuSupplierSellStatisticsDO> supplierSellStatistics;



}
